<%@ Page Language="C#" MasterPageFile="~/MasterPages/Grey/Grey.Master" AutoEventWireup="true"
    CodeBehind="WebSite.aspx.cs" Inherits="mmq.WebSite" Title="<%$ Resources:GlobalResource,WebSitePageTitle %>"
    Theme="Grey" %>

<%@ Import Namespace="System.Data" %>
<%@ Register Src="UserControls/TreeEditor.ascx" TagName="TreeEditor" TagPrefix="uc2" %>
<%@ Register Src="UserControls/HeaderMenu.ascx" TagName="HeaderMenu" TagPrefix="uc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Left" runat="server">
    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
    <asp:Repeater ID="MainPage" runat="server">
        <HeaderTemplate>
            <table width="100%" id="categorytable">
                <tr>
                    <td>
                        <h2>
                            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:GlobalResource,AffiliateWebSites%>" /></h2>
                    </td>
                </tr>
        </HeaderTemplate>
        <SeparatorTemplate>
            <tr>
                <td>
                    <asp:Image SkinID="SeparatorImage" runat="server" ID="Separator" Style="display: block;
                        margin-left: auto; margin-right: auto" />
                </td>
            </tr>
        </SeparatorTemplate>
        <ItemTemplate>
            <tr>
                <td class="helpBod">
                    <h3>
                        <%# DataBinder.Eval(Container.DataItem, "title")%>
                    </h3>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Repeater ID="rptr_Detailes" runat="server" DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("ParentChild") %>'>
                        <HeaderTemplate>
                            <table width="100%" class="websitestable">
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td class="helpHed" colspan="2">
                                    <h3>
                                        <%# DataBinder.Eval(Container.DataItem, "[\"Title\"]")%>
                                    </h3>
                                </td>
                            </tr>
                            <tr>
                                <td class="helpT">
                                    <a href='<%# DataBinder.Eval(Container.DataItem, "[\"RefUrl\"]")%>' runat="server">
                                        <img alt="" src='<%# DataBinder.Eval(Container.DataItem, "[\"ScreenShot\"]")%>' runat="server" />
                                    </a>
                                </td>
                                <td class="tdcontent">
                                    <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:GlobalResource,Publisher%>" />
                                    :
                                    <%# DataBinder.Eval(Container.DataItem, "[\"Publisher\"]")%>
                                    <p>
                                        <%# DataBinder.Eval(Container.DataItem, "[\"Description\"]")%>
                                    </p>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <div style="float: right">
        <asp:LinkButton runat="server" ID="lnkBtn_NewReview" Text="<%$ Resources:GlobalResource,NewWebSite %>" />
    </div>

    <script language="javascript" type="text/javascript">
        function OnNodeClick(selected_node_value, selected_node_text, literalctrl, hf_selectedValue, btn_ok) {
            document.getElementById(literalctrl).innerText = " : " + selected_node_text;
            document.getElementById(btn_ok).style.visibility = "visible";
            document.getElementById(hf_selectedValue).value = selected_node_value;
        }
        function GetHtmlEditor() {
            return $find('<%= HtmlEditor1.ClientID %>');
        }
    </script>

    <asp:Panel ID="popup_panel" runat="server" Style="display: none" CssClass="modalPopup"
        Width="700px">
        <div class="pcol2">
            <div class="pleft">
                <p>
                    <asp:Label ID="label1" runat="server" Text="<%$ Resources:GlobalResource,Comment_SelectCategory %>" />
                </p>
                <uc2:TreeEditor ID="TreeEditor2" runat="server" />
            </div>
            <div class="pright">
                <table border="0" class="edittable">
                    <tr>
                        <td style="width: 100px;">
                        </td>
                        <td>
                            <p>
                                <asp:Label ID="label2" runat="server" Text="<%$ Resources:GlobalResource,Comment_CategorySelected %>"
                                    CssClass="small" />
                                <asp:Label ID="label_category" runat="server" CssClass="small" />
                                <asp:HiddenField ID="hf_selectedValue" runat="server" />
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label Text="<%$ Resources:GlobalResource,Title %>" runat="server" ID="lblTitle"
                                CssClass="small" />
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtBoxTitle" Columns="50" CssClass="small" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label Text="<%$ Resources:GlobalResource,RefUrl %>" runat="server" ID="Label3"
                                CssClass="small" />
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtBoxRefUrl" Width="400px" Columns="256" CssClass="small" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:GlobalResource,Language%>" />
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="ddl_Language" SelectedValue='<%# Profile.GetPropertyValue("PreferredCulture").ToString() %>'>
                                <asp:ListItem Text="<%$ Resources:GlobalResource,Chinese%>" Value="zh-CN" />
                                <asp:ListItem Text="<%$ Resources:GlobalResource,English%>" Value="en-US" />
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label Text="<%$ Resources:GlobalResource,ScreenShot %>" runat="server" ID="Label4"
                                CssClass="small" />
                        </td>
                        <td>
                            <asp:Button ID="btnUploaded" Style="display: none;" UseSubmitBehavior="false" runat="server"
                                OnClick="btnUploaded_Click" />
                            <iframe src="UploadFile.aspx" frameborder="0" width="400px" height="60px">Your browser
                                does not support iframes </iframe>
                            <asp:TextBox ID="txtScreenShot" runat="server" CssClass="small" Columns="100" Width="400px" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <htmlEditor:HtmlEditor ID="HtmlEditor1" runat="server" />
                        </td>
                    </tr>
                </table>
                <asp:LinkButton runat="server" CausesValidation="true" ID="btn_Ok" Text="<%$ Resources:GlobalResource,Submit %>"
                    Style="visibility: hidden" OnClick="btn_Ok_Click" />
                <asp:LinkButton runat="server" ID="btn_Cancel" Text="<%$ Resources:GlobalResource,Return %>" />
            </div>
        </div>
    </asp:Panel>
    <ajaxControlToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lnkBtn_NewReview"
        PopupControlID="popup_panel" CancelControlID="btn_Cancel" BackgroundCssClass="modalBackground">
    </ajaxControlToolkit:ModalPopupExtender>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Right" runat="server">
    <uc2:TreeEditor ID="TreeEditor1" runat="server" />
</asp:Content>
<asp:Content ContentPlaceHolderID="navigation" runat="server">
    <uc1:HeaderMenu ID="HeaderMenu1" runat="server" SelectedTab="Affiliates" />
</asp:Content>
